<script src="/res/editor/js/webeditor.js" tppe="text/javascript"></script>
<script src="/js/cartoon.js" tppe="text/javascript"></script>
<script src="/js/UrlUtil.js" tppe="text/javascript"></script>
<style>
div,ul{padding:0;margin:0;}
#header{width:1000px;border:1px #6fc solid;height:40px;text-align:center;}
#header label{width:100px;border:1px  solid;float:left;margin:0 auto;}
#header ul{width:998px;border:1px #6fc solid;height:20px;margin:0 auto;}
#header ul li{float:left;padding:0 5px 0 5px;list-style-type:none;}
#header ul li span{cursor:pointer; font-size:14;float:left;padding:0 5px ;}
</style>
<div id="header">
	<label >显示位置：</label>
	<ul>
		<li><span  onclick="req_link('pos',0)">全部</span></li>
		<li><span  onclick="req_link('pos',1)">首页</span></li>
		<li><span  onclick="req_link('pos',2)">二级页</span></li>
	</ul>
</div>
<form>
<table class="mlist"  cellpadding="0" width="50%" cellspacing="0" style="float: left">
	<thead align="center">
		<td nowrap></td>
		<td nowrap>id</td>
		<td nowrap>标题</td>
		<td nowrap>图片</td>
		<td nowrap>描述</td>
		<td nowrap>链接</td>
		<td nowrap>排序</td>
		<td nowrap>显示位置</td>
		<td nowrap>创建时间</td>		
		<td nowrap>操作</td>
	</thead>
	<?if($this->ret['data']):?>
	<? foreach ($this->ret['data'] as $row):?>
	<tr align="left">
		<td nowrap><input type="checkbox" value="<?=$row['adv_id']?>" /></td>
		<td nowrap><?= $row['adv_id']?></td>
		<td nowrap><a href="<?=$row['adv_link']?>" target="_blank" ><?= $row['adv_title']?></a></td>
		<td nowrap><a href="<?=$row['adv_link']?>" target="_blank" ><img src="<?=$row['adv_logo']?>" alt="<?= $row['adv_title']?>" /></a></td>
		<td>
		<?=$row['adv_desc']?>
		</td>		
		<td><?=$row['adv_link']?></td>
		<td><?=$row['adv_order']?></td>
		<td><?=$row['adv_position']==1?'显示':'二级页面'?></td>
		<td>
		<?=date('Y-m-d H:i',$row['adv_time'])?>
		</td>
		<td nowrap align="left">
		<a href="javascript:void(0);" onclick="Cartoon.delAdv(<?=$row['adv_id']?>)">删除</span>
		</td>
	</tr>
	<? endforeach;?>
	<?else:?>
	<tr align="center">
	<td colspan="10">暂无记录</td>
	</tr>
	<?endif;?>
	<thead>
	<td colspan="6">
	<input type="checkbox" id="chkall" onclick="Cartoon.chkall('chkall')" />
	<span>设置为：</span>
	<select name="sel_pos" id="sel_pos">
			<option value="1">首页</option>
			<option value="2">二级页</option>
		</select>
		&nbsp;<input type="button" value="确定" onclick="" />
		或者&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="删除所选" onclick="Cartoon.delAdv();" />
	</td>
	<td colspan="4"><?=$this->ret['pages']?></td>
	</thead>
</table>
</form>
<div style="float:left; padding-left: 10px">

</div>
<form  action="<?=self::_makeURL('cartoon','adv','add')?>" method="POST" enctype="multipart/form-data">
<table class="mlist"  cellpadding="0" width="50%" cellspacing="0" style="float: left">
	<thead align="center">
		<td nowrap colspan="2">添加</td>
	</thead>
	<tr align="left">
		<td nowrap>标题：</td>
		<td nowrap><input class="input_text"  type="text" name="title"  size="25" />
		</td>
	</tr>
	<tr align="left">
		<td nowrap>图片：</td>
		<td nowrap>
		<input type="file" name="logo" id="logo" />
		</td>
	</tr>
	<tr align="left">
		<td nowrap>链接：</td>
		<td nowrap>
		<input type="text" class="input_text" name="link" size="25" />
		</td>
	</tr>
	<tr align="left">
		<td nowrap>描述：</td>
		<td nowrap>
		<textarea name="info"></textarea>
		</td>
	</tr>
	<tr align="left">
		<td nowrap>排序：</td>
		<td nowrap>
		<input type="text" class="input_text" name="order" size="25" />
		</td>
	</tr>
	<tr align="left">
		<td nowrap>显示位置：</td>
		<td nowrap>
		<select name="pos" >
			<option value="1">首页</option>
			<option value="2">二级页</option>
		</select>
		</td>
	</tr>
	<thead>
	<td colspan="2" align="center"><input type="submit" value="添加" /></td>
	</thead>
</table>
</form>
